@extends('layouts.app')

@section('content')

<link href="{{ URL::asset('/') }}css/jedate.css" rel="stylesheet" id="jeDateSkin">
   <script src="{{ URL::asset('/') }}js/jedate/jedate.js"></script>



    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li>行政案件</li>
                <li><a href="javascript:;">添加案件</a> </li>
            </ul>
        </div>
        <div class="main-content">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#home" data-toggle="tab">添加</a></li>
            </ul>

            <div class="row">
                <div class="col-md-6">
                    <br>
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane active in" id="home">
                            <form id="tab" class="form-horizontal" method="post">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">


                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">案件名称</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="case_name" id="case_name" placeholder="案件名称" value="" required>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="input7" class="col-sm-2 control-label">案件类型</label>
                                    <div class="col-sm-10">
                                    <select name="case_type" class="form-control">

                                      @foreach ($type as $key=>$type)
                                      <option value="{{ $type->id }}">{{ $type->name }}</option>
                                      @endforeach

                                    </select>
                                  </div>
                                </div>

                                <div class="form-group">
                                    <label for="input2" class="col-sm-2 control-label">地址</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="case_company" id="case_company" placeholder="地址" value="">
                                    </div>
                                </div>



                                  <div class="form-group">
                                      <label for="input7" class="col-sm-2 control-label">所属单位</label>
                                      <div class="col-sm-10">
                                      <select name="case_address" class="form-control">

                                       @foreach ($units as $key=>$units)

                                        @if($units->id === $un->unit_id )
                                        <option value="{{ $units->id }}" selected="selected">{{ $units->name }}</option>
                                        @else
                                          <option value="{{ $units->id }}">{{ $units->name }}</option>
                                        @endif

                                        @endforeach

                                
                                      </select>
                                    </div>
                                  </div>

                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">整改区域</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="case_area" id="case_area" placeholder="整改区域" value="">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">整改项目名</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="case_project" id="case_project" placeholder="整改项目名" value="">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">检查时间</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="case_checktime" id="dateinfo" placeholder="请选检查时间" value="{{$un->created_at}}" readonly>
                                    </div>
                                </div>





                                <div class="form-group">
                                    <label for="input1" class="col-sm-2 control-label">详细描述</label>
                                    <div class="col-sm-10">
                                      <textarea name="case_desc" style="margin: 0px; width: 532px; height: 248px;"></textarea>

                                    </div>
                                </div>







                                <div class="btn-toolbar list-toolbar btn-toolbar2">
                                    <input type="submit" value="录入" class="btn btn-primary">
                                    <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        /*时间*/
        jeDate({
            dateCell: "#dateinfo",
            format: "YYYY-MM-DD hh:mm:ss",
            isinitVal: true,
            isTime: true, //isClear:false,
            minDate: "2014-09-19 00:00:00",
            okfun: function (val) {
            }
        })
    </script>


    <script type="text/javascript">
        $(function(){
            $('.valid').on('click',function(){
                if(this.checked){
                    $(this).parents('.panel').children('.panel-body').find('input').prop("checked", true);
                }else{
                    $(this).parents('.panel').children('.panel-body').find('input').prop("checked", false);
                }
            })
        })
    </script>
@stop
